package com.teapos.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.teapos.enumtype.Unit4SaveEnum;

public class UnitTag extends TagSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6925632873297611799L;
	
	private int unit;

	@Override
	public int doStartTag() throws JspException {
		try {
			pageContext.getOut().write(Unit4SaveEnum.getEnumByCode(unit).getDesc());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return super.doStartTag();
	}

	public void setUnit(int unit) {
		this.unit = unit;
	}

}
